package com.example.streamdemo.consumer;

import com.example.streamdemo.channel.MyInputChannel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Component;

/**
 * @Package: com.example.streamdemo.consumer
 * @ClassName: MyMessageConsumer
 * @Author: Think
 * @CreateTime: 2021/7/16 8:33
 * @Description:
 */
@Slf4j
@Component
@EnableBinding(MyInputChannel.class)
public class MyMessageConsumer2 {

    @StreamListener("myInput")
    public void receive(String message){
        log.info("myInput监听到消息内容为：{}", message);
    }

}
